package com.cy.pj.sys.dao;


import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import com.cy.pj.common.vo.Node;
import com.cy.pj.sys.entity.SysMenu;

@Mapper
public interface SysMenuDao {
	/**
	 * 查询
	 * @return
	 * 
	 */
	//@Delete("delete from")
	List<Map<String,Object>> findObjects();
	/**
	 * 
	 * @param id 统计子菜单的个数
	 * @return
	 */
	@Select("select count(*)  from sys_menus  where parentId=#{id} ")
	int getChildCount(Integer id);
	@Delete(" delete from sys_menus where id =#{id}")
	int deleteObject(Integer id);
	
	//查询所有的菜单的id,name,parentId信息
	List<Node> findZtreeMenuNodes();
	
	int insertObject(SysMenu entity);
	int UpdateObject(SysMenu entity);
}
